const app = getApp()
Page({

  data: {
    store:[],
    config:{}
	},
	
	onShow: function (){
    this.setData({
      config:app.globalData.appConfig
    })
		app.isLogin(()=>{
			this.storeApi();
		})
	},
	
  //下拉刷新
  onPullDownRefresh: function () {
    wx.showNavigationBarLoading();
    setTimeout(()=>{
      wx.hideNavigationBarLoading();
      wx.stopPullDownRefresh();
    },1500);
    this.setData({
      loading: true,
      page:0,
      coupon:[]
    });
    this.storeApi();
  },
  //读取优惠券
  storeApi: function () {
    app.api().Get('api/v1/smartbc/store/storeData',(result) => {
      this.setData({
        store:  result.data,
      });
    })
  }
})